package com.ww.learn.oop.extend

/**
 * super关键字调用其超类的函数与属性访问器的实现
 */
open class Rectangle {
    open fun draw() {
        println("画矩形")
    }

    val borderColor: String get() = "黑色"
}

class FilledRectangle : Rectangle() {
    override fun draw() {
        super.draw()
        println("填充矩形")
    }

    val fillColor: String get() = super.borderColor
}